<%--
  Created by IntelliJ IDEA.
  User: H-209-FX-XY
  Date: 2018/3/23
  Time: 10:50
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="s" uri="/struts-tags" %>
<html>
<head>
    <title>Title</title>
    <h1>保存商品的页面</h1>
    <s:form action="save" method="POST" namespace="/" theme="simple">
        <table border="1" width="400">
            <s:fielderror/>
            <tr>
                <td>商品名称</td>
                <td><s:textfield name="product.pname"/></td>
            </tr>
            <tr>
                <td>商品价格</td>
                <td><s:textfield name="product.price"/></td>
            </tr>
            <tr>
                <td colspan="2"><input type="submit" value="添加"/></td>
            </tr>
        </table>
    </s:form>
    <s:if test="productList.size() > 0 ">
    <table border="1px" cellpadding="8px">
        <tr>
            <th>pid</th>
            <th>name</th>
            <th>price</th>
        </tr>
        <s:iterator value="productList">
            <tr>
                <td><s:property value="pid" /></td>
                <td><s:property value="pname" /></td>
                <td><s:property value="price" /></td>
            </tr>
        </s:iterator>
    </table>
    </s:if>
</head>
<body>

</body>
</html>
